<?php

namespace App\Transformers;


use App\Models\StatisticPhoneRecord;
use League\Fractal\TransformerAbstract;

class StatisticPhoneRecordTransformer extends TransformerAbstract
{
    public function transform(StatisticPhoneRecord $phoneRecord)
    {
        return [
            'id' => $phoneRecord->id,
            'call_times' => $phoneRecord->call_times,
            'visit_number' => $phoneRecord->visit_number,
            'connect_number' => $phoneRecord->connect_number,
            'login_number' => $phoneRecord->login_number,
            'charge_number' => $phoneRecord->charge_number,
            'type' => $phoneRecord->type,
            'any_id' => $phoneRecord->any_id,
            'created_at' => $phoneRecord->created_at->toDateTimeString(),
            'updated_at' => $phoneRecord->updated_at->toDateTimeString(),
        ];
    }
}